# *-* coding=utf-8 *-
#a global class list
#这个 list 暂时只包含 component
import global_var
import os
from file_ import *
import breed_lex

class_list = {}

def ADD ( classname ,classdef ):
	class_list[classname] = classdef

def CALL(class_name,modulename):
	if class_name == "component":
		file_name = importname_filename(modulename)
		if haveFile(file_name) == None:
			pass
		else:
			s = getSource( haveFile(file_name) )
			lexer = breed_lex.getlex()
			lexer.input(s)
			tokenList = getTokenList(lexer)
			print tokenList.popleft()
			class_list[class_name]().compile(tokenList)


